
import 'package:flutter/material.dart';
import 'package:rabbit/api/ArticleApi.dart';

class ApplyPage extends StatefulWidget {
  ApplyPage({Key key, this.title}) : super(key: key);
  final String title;
  @override
  _ApplyPageState createState() => _ApplyPageState();
}


class _ApplyPageState extends State<ApplyPage> {
  int _counter = 0;


  @override
  void initState() {
    ArticleCateApi.listCates().then((value) => {
      value.forEach((element) {
        print(element.cateName);
      })
    });
  }

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(""),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ),
    );
  }
}